package cn.smile.controller;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: MaoSuyu
 * @User：John
 * @Date: 2019/5/16
 * @Time: 17:05
 * @Description: No Description
 */
@RestController
@ConfigurationProperties(prefix = "book")
//类型安全的配置
@PropertySource("classpath:/attribute.properties")
public class DemoController {

    @RequestMapping("/")
    public String demo() {
        int i = 5 / 0;
        return "Hello SpringBoot \t 毛苏雨";
    }


    private String name;
    private double money;
    private String author;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

}
